AUX_SOURCE_DIRECTORY(. SRC_LIST)
ADD_EXECUTABLE(curltest ${SRC_LIST})
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
#INCLUDE_DIRECTORIES(/usr/include)
#TARGET_LINK_LIBRARIES(curltest curl)
FIND_PACKAGE(CURL)
IF (CURL_FOUND)
    MESSAGE(STATUS "CURL_INCLUDE_DIR: " ${CURL_INCLUDE_DIR} " CURL_LIBRARY: " ${CURL_LIBRARY})
    INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
    TARGET_LINK_LIBRARIES(curltest ${CURL_LIBRARY})
ELSE(CURL_FOUND)
    MESSAGE(FATAL_ERROR "CURL library not found")
ENDIF(CURL_FOUND)

#对于系统预定义的Find<name>.cmake模块，使用方法一般如上所示：
#每一个模块都会定义以下几个变量
#• <name>_FOUND   通过此变量判断模块是否被找到
#• <name>_INCLUDE_DIR or <name>_INCLUDES
#• <name>_LIBRARY or <name>_LIBRARIES
